package com.zui.entity.product;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import org.apache.struts2.json.annotations.JSON;

import com.zui.entity.BaseAutoIdEntity;



@Entity
//product, feature, fromDate唯一性；
@Table(name="product_feature_appl",
uniqueConstraints={@UniqueConstraint(name="uc_product_feature_appl",
		columnNames={"productId", "featureId", "fromDate"})})
public class ProductFeatureAppl extends BaseAutoIdEntity {
	private static final long serialVersionUID = 1L;
	
	public ProductFeatureAppl() {}
	
	private Product product;
	private Feature feature;
	private ProductFeatureApplType productFeatureApplType;
	private Date fromDate;
	private Date thruDate;
	private Integer sequenceNum;
	/**
	 * ??
	 */
	private Double amount;
	/**
	 * ??
	 */
	private Double recurringAmount;



	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	@ManyToOne() @JoinColumn(name="productId")
	@JSON(serialize=false)
	public Product getProduct() {return product;}
	@ManyToOne() @JoinColumn(name="featureId")
	public Feature getFeature() {return feature;}
	@ManyToOne
	@JoinColumn(name="productFeatureApplTypeId")
	public ProductFeatureApplType getProductFeatureApplType() {return productFeatureApplType;}
	public Date getFromDate() {return fromDate;}
	public Date getThruDate() {return thruDate;}
	public Integer getSequenceNum() {return sequenceNum;}
	public Double getAmount() {return amount;}
	public Double getRecurringAmount() {return recurringAmount;}
	
	
	
	public void setProduct(Product product) {
		this.product = product;
	}
	public void setFeature(Feature feature) {
		this.feature = feature;
	}
	public void setProductFeatureApplType(ProductFeatureApplType productFeatureApplType) {
		this.productFeatureApplType = productFeatureApplType;
	}
	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}
	public void setThruDate(Date thruDate) {
		this.thruDate = thruDate;
	}
	public void setSequenceNum(Integer sequenceNum) {
		this.sequenceNum = sequenceNum;
	}
	public void setAmount(Double amount) {
		this.amount = amount;
	}
	public void setRecurringAmount(Double recurringAmount) {
		this.recurringAmount = recurringAmount;
	}
	
}
